﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using TestMySqlConnetPoll;

namespace View.Journal
{
    /// <summary>
    /// 用户操作工作日志
    /// </summary>
    public partial class UserOperaLogForm : DevExpress.XtraEditors.XtraForm
    {
        private SysLogTable syslog;
        public UserOperaLogForm()
        {
            syslog = new SysLogTable();
            InitializeComponent();

            //设置日志类型初始选择
            comboBox_type.SelectedIndex = 0;
            dateEdit_S.EditValue = DateTime.Now;
            dateEdit_E.EditValue = DateTime.Now;
        }

        private void simpleButton3_Click(object sender, EventArgs e)
        {

        }

        private void ComboBox_type_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.Text = (string)comboBox_type.SelectedItem;
        }

        private void Search()
        {
            DateTime dt= (DateTime)this.dateEdit_S.EditValue ;
            objDate data = new objDate();
            data.year = dt.Year;
            data.month = (byte)dt.Month;
            data.day = (byte)dt.Day;
            syslog.ReadValueList(data, (string)this.comboBox_type.SelectedItem);
        }

        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnS_Click(object sender, EventArgs e)
        {
            Search();
        }
    }
}